package cc.vv.baselibrary.util;

/**
 * 防止按钮多次点击
 *
 * @author huijitao
 */
public class SingleClickUtil {


    // 两次点击按钮之间的点击间隔不能少于1000毫秒
    private final int MIN_CLICK_DELAY_TIME = 1000;
    private long lastClickTime = 0;


    public boolean isNotFastClick() {
        long curClickTime = System.currentTimeMillis();
        if ((curClickTime - lastClickTime) >= MIN_CLICK_DELAY_TIME) {
            lastClickTime = curClickTime;
            return true;
        }
        return false;
    }
}
